map operator [] operands

Posted by Jamie Cook on Stack Overflow See other posts from Stack Overflow or by Jamie Cook
Published on 2010-05-05T10:05:16Z Indexed on 2010/05/05 10:08 UTC
Read the original article Hit count: 249

Filed under:
|
|

Hi all I have the following in a member function

int tt = 6; 
vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt]; 
set<int>& egressCandidateStops = temp.at(dest);

and the following declaration of a member variable

map<int, vector<set<int>>> m_egressCandidatesByDestAndOtMode;

However I get an error when compiling (Intel Compiler 11.0)

1>C:\projects\svn\bdk\Source\ZenithAssignment\src\Iteration\PtBranchAndBoundIterationOriginRunner.cpp(85): error: no operator "[]" matches these operands
1>            operand types are: const std::map<int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>, std::less<int>, std::allocator<std::pair<const int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>>>> [ const int ]
1>          vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt]; 
1>                                                                    ^

I know it's got to be something silly but I can't see what I've done wrong.

© Stack Overflow or respective owner

Related posts about c++

Related posts about map